package com.teamc.team.mapper;

import com.teamc.team.entity.Object;
import com.teamc.team.entity.SysUser;
import com.teamc.team.entity.User;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.teamc.team.vo.AdminUserVO;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author ding
 * @since 2021-06-10
 */
@Repository
public interface UserMapper extends BaseMapper<User> {
    boolean haveIt(@Param("id")String id);

    @Select("select count(*) from team_user where user_id='#{id}' and user_password='#{password}'")
    boolean haveThisAccount(@Param("id")String id,@Param("password")String password);

    @Select("select * from team_user where user_id=#{id}")
    User getUser(@Param("id") String id);

    @Insert("insert into team_user (user_id, user_password) values (#{id},#{password})")
    boolean addUser(@Param("id")String id,@Param("password") String password);

    SysUser selectUserByName(String name);

    List<AdminUserVO> listAllUser();
}
